﻿using Library.Common;
using LogForParameter.IServices.ActivityService;
using Microsoft.Extensions.Logging;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LogForParameter.IServices
{
    [DisallowConcurrentExecution]
    public class ASMJOB : IJob
    {
        private readonly ILogger<ASMJOB> _logger;

        private readonly IActivityServices _activityServices;

        public int ActivityId { get; set; }

        //
        public ASMJOB(ILogger<ASMJOB> logger,IActivityServices activityServices)
        {
            _logger = logger;
            _activityServices = activityServices;
        }
        public Task Execute(IJobExecutionContext context)
        {
            return Task.Factory.StartNew(async () =>
              {
                  _logger.LogWarning("正在执行工作!");
                  //await _activityServices.AddASM();
                  await _activityServices.ActivityNotice();
              });
        }
    }
}
